from fastapi import FastAPI
from pydantic import BaseModel
from typing import Dict, Any

app = FastAPI()

@app.get("/")
def read_root():
    return {"Hello": "World"}

# 定义一个通用的请求体模型
class NoticeRequest(BaseModel):
    data: Dict[str, Any]

@app.post("/notice")
def notice(request: NoticeRequest):
    print(request.data)
    return {"status": "received"}

if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=10611)